﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OnlineMovieTicket.Data.IRepository;

namespace OnlineMovieTicket.Data.Repository
{
    public class CinemaRepository : ICinemaRepository
    {
        ONLINEMOVIETICKETEntities dataContent;

        public CinemaRepository()
        {
            this.dataContent = new ONLINEMOVIETICKETEntities();
        }

        public IList<Model.Cinema> GetCinemas()
        {
            var data = (from d in dataContent.Cinemas
                       select new Model.Cinema
                       {
                           CinemaID = d.CinemaID,
                           CinemaName = d.CinemaName,
                           CinemaLocation = d.CinemaLocation
                       }).ToList();
            return data;
        }

    }
}
